<?php
use yii\helpers\Url;
use backend\components\LanguageTemplate;

?>
<!-- Left navbar-header -->
<div class="navbar-default sidebar" role="navigation">
    <div class="sidebar-nav navbar-collapse slimscrollsidebar">
    <ul class="nav" id="side-menu">
        <li class="sidebar-search hidden-sm hidden-md hidden-lg">
            <!-- input-group -->
            <div class="input-group custom-search-form">
                <input type="text" class="form-control" placeholder="Search..."> <span class="input-group-btn">
            <button class="btn btn-default" type="button"> <i class="fa fa-search"></i> </button>
            </span> </div>
            <!-- /input-group -->
        </li>
        <?php if ( isset($this->params['module_menu']) ) : ?>
        <?php foreach ($this->params['module_menu'] as $key => $item): ?>
            <?php if(!isset($item['submenu'])) : ?>
                <li>
                    <a href="<?=$item['url'];?>" class="waves-effect">
                        <i class="<?=$item['icon']?> fa-fw"></i>
                        <?=LanguageTemplate::tBackend($item['title'])?>
                    </a>
                </li>
            <?php else:?>
                <li <?= in_array(yii::$app->controller->id,['stock','supplier','purchase-order','return-goods-order','goods-check'])?'class="active"':''?>>
                    <a href="#" class="waves-effect dropdown-toggle">
                        <i class="<?=$item['icon']?> fa-fw"></i>
                        <?=LanguageTemplate::tBackend($item['title'])?>
                    </a>
                    <?php foreach ($item['submenu'] as $k => $value): ?>
                    <ul class="submenu">
                        <a href="<?=$value['url'];?>" class="waves-effect">
                            <i class="<?=$value['icon']?> fa-fw"></i>
                            <?=LanguageTemplate::tBackend($value['title'])?>
                        </a>
                    </ul>
                    <?php endforeach ?>
                </li>
            <?php endif?>
        <?php endforeach ?>
        <?php endif?>
    </ul>
</div>
</div>
<!-- Left navbar-header end -->